﻿namespace ufida.u9.ait.openapi
{
    using System;
    using System.Collections.Generic;
    using System.IO;
    using ufida.u9.ait.openapi.utils;
    using UFIDA.U9.Base;
    using UFIDA.U9.Base.Currency;
    using UFIDA.U9.Base.Doc;
    using UFIDA.U9.Base.Memo;
    using UFIDA.U9.CBO.FI.FN;
    using UFIDA.U9.CBO.FI.MatchLayerSet;
    using UFIDA.U9.CBO.FI.Tax;
    using UFIDA.U9.CBO.HR.Department;
    using UFIDA.U9.CBO.HR.Operator;
    using UFIDA.U9.CBO.Pub.Controller;
    using UFIDA.U9.CBO.SCM.AccrueBy;
    using UFIDA.U9.CBO.SCM.Item;
    using UFIDA.U9.CBO.SCM.ProjectTask;
    using UFIDA.U9.CBO.SCM.Supplier;
    using UFIDA.U9.MO.SFC.DispatchCODocApprove.Data;
    using UFIDA.U9.PM.DTOs;
    using UFIDA.U9.PM.Enums;
    using UFIDA.U9.PM.PO;
    using UFIDA.U9.PM.Pub;
    using UFIDA.U9.PR.PurchaseRequest;
    using UFIDA.U9.QC.QCDocBE;
    using UFIDA.U9.SM.SO;
    using UFSoft.UBF.AopFrame;
    using UFSoft.UBF.Business;

    /// <summary>
    /// POSaveSV partial 
    /// </summary>	
	public partial class POSaveSV 
	{	
		internal BaseStrategy Select()
		{
			return new POSaveSVImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class POSaveSVImpementStrategy : BaseStrategy
	{
		public POSaveSVImpementStrategy() { }

		public override object Do(object obj)
		{						
			POSaveSV bpObj = (POSaveSV)obj;
            return CodeUtils.DocSaveRT<POAITDTOData, PurchaseOrder>(bpObj, bpObj.Data,
                POBase.CreateDoc, doc =>
                {
                    POBase.CommitDoc(doc);
                    POBase.ApproveDoc(doc);
                    return doc;
                });
        }

    }

	#endregion
	
	
}